{include file="public/header"/}
{load href="/public/static/Content/ThemesBusiness/FormPage.css"}
 <!--引入引入kindeditor编辑器相关文件-->
    <link rel="stylesheet" href="/public/static/kindeditor-4.1.10/themes/default/default.css"/>
    <script charset="utf-8" src="/public/static/kindeditor-4.1.10/kindeditor-all.js"></script>
    <script charset="utf-8" src="/public/static/kindeditor-4.1.10/lang/zh_CN.js"></script>
<form id="formState" style="width:95%; text-align:center;">
    <table class="form_table" width="860px" style=" margin:0 auto;">
       
      

        <tr class="form_tr">
          <!--   <th style="padding-left:8px;width:80px;" class="form_td form_th_title">
                保修卡介绍
            </th> -->
            <td colspan="5" style="width:100%;padding-left:8px; height:650px;border: none" class="form_td form_td_content">
                <textarea class="easyui-validatebox" name="card_desc" style="height:650px;width:100%;"
                          data-options="tipPosition:'right'" id="editor" >{$info.card_desc}</textarea>
            </td>
        </tr>
      
       
        <tr class="form_tr">
            <td class="form_button_panel" colspan="5" style="padding-right:8px">
                
                <a  id="save"  class="easyui-linkbutton form-toolbar-button" data-options="iconCls:'icon-save'">保存</a>
              
            </td>
        </tr>
    </table>
</form>

<script type="text/javascript">
 $(function () {
        //详情编辑器
        KindEditor.ready(function (K) {
            this.editor
                = K.create('textarea[id="editor"]', {
                items: ['source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste',
                    'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
                    'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
                    'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
                    'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
                    'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'multiimage',
                    'table', 'hr', 'emoticons', 'baidumap', 'pagebreak',
                    'anchor', 'link', 'unlink'],
                uploadJson: '/images',//指定上传图片的服务器端程序
                fileManagerJson: '/images',//指定浏览远程图片的服务器端程序
                allowFileManager: true
            });
        });
    });
</script>
<script>
   $(function() {
       $("#save").on("click",function(){
                var content = editor.html();
                var data = {"card_desc": content}
                $.ajax({
                       type: 'POST',
                       url: "{:url('admin/card/report_save')}",
                       //data:  $("#formState").serialize(),
                       data:data,
                       dataType: "json",
                       async: false,
                    error: function(request) {
                        alert("发送请求失败！");
                    },
                   success: function(data){
                        if (data.status == 1) {          
                            $.messager.alert('提示', data.msg, 'info');
                            //location.reload();
                              //closeDialog();
                        } else {
                            $.messager.alert('提示', data.msg, 'error');
                           // return;
                           // alert(data.msg);
                    
                        }
                       
                    } 
                });
       })
    })

   
</script>

{include file="public/footer"/}